// 比如商城类 购物车管理模块
let resStore = {
    state:{
        playlist:[],
        newSong:[],
        musiclist : {
        title: '默认',
        artist:'默认',
        src: "/",
        pic: 'https://p1.music.126.net/tczb_7II9KzSuLQsVt89Gw==/109951163049336667.jpg',
        },
        musicList:[],
        //监听播放列表哪一首是红色
        idx:'',
        // 当前播放的音乐
        nowplaymusic:{
            title :'',
            artist:'',
            src:'',
            pic:'',
            id:'',
            // // 总时间
            duration:'0',
            // // 当前播放时间
            // timenow:'默认',
            // 歌词
            Word:''
        },
        // 当前播放时间
        timenow:''
    },
    mutations:{
        addMsg(state,msg){
            state.playlist = msg
        },
        addMusic(state,music){
            state.newSong = music
        },
        getUrl(state,item){
            state.nowplaymusic = item
        },
        setTime(state,item){
            state.timenow = item
        },
        setpalyList(state,item){
            state.musicList.push(item)
        },
        setIdx(state,item){
            state.idx = item
        }
    },
    getters:{
        msg: state => state.playlist,
        music: state => state.newSong,
        url: state => state.musiclist,
        newurl: state => state.nowplaymusic,
        timenow: state => state.timenow,
        newmusicList: state => state.musicList,
        myidx: state => state.idx,
    },
}

export {resStore}